<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%
	String path =request.getContextPath();
%>
<head>
    <meta http-equiv="x-ua-compatible" content="ie=7" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
         <script language="javascript" type="text/javascript">

     	//全选
    	function ChkAllClick(sonName, cbAllId){
    		var arrSon = document.getElementsByName(sonName);
    	 	var cbAll = document.getElementById(cbAllId);
    	 	var tempState=cbAll.checked;
    	 	for(i=0;i<arrSon.length;i++) {
    	  		if(arrSon[i].checked!=tempState){
    	        	arrSon[i].click();
    	 		}
    		}
    	}

    	// --子项复选框被单击---
    	function ChkSonClick(sonName, cbAllId) {
    		var arrSon = document.getElementsByName(sonName);
    	 	var cbAll = document.getElementById(cbAllId);
    	 	for(var i=0; i<arrSon.length; i++) {
    	    	if(!arrSon[i].checked) {
    	     		cbAll.checked = false;
    	     		return;
    	     	}
    	 	}
    	 	cbAll.checked = true;
    	}

    	// --反选被单击---
    	function ChkOppClick(sonName){
    		var arrSon = document.getElementsByName(sonName);
    	 	for(i=0;i<arrSon.length;i++) {
    	  		arrSon[i].click();
    	 	}
    	}
    	
    	 //添加数据
        function addOrderArrPlan(){
        	var arrSon = document.getElementsByName("checkBox");
        	var row=0;
        	for(i=0;i<arrSon.length;i++) {
        		if(arrSon[i].checked) {
	        		var pkOrderItem=arrSon[i].id;
	        		row=row+1;
		  			document.getElementById("pk_"+pkOrderItem).value=pkOrderItem;
        		}
    		}
    		if(row==0){
				alert("请选择要新增的发货通知数据");
				return ;
    		}else{
	        	form2.action="<%=path%>/other/addQryData2NewPage";
	        	form2.submit();
    		}
        }

        function  goback() {
			var url="<%=path%>/other/goback2AddPage";
			location.href = url;
        }
    </script>
</head>
<body class="fullbody">
            <div class="context">
                <div class="position">
                    <div class="tposi">当前位置：
                        <a href="javascript:changeMenu(1,'<%=path%>/infopub/pubmain?menuid=1');"class="linkstyle">首页</a>&nbsp;&gt;&gt;&nbsp;
                   		<a href="javascript:changeMenu(3,'');" class="linkstyle">我的订单\合同</a>&nbsp;&gt;&gt;&nbsp;
                        <span class="curposition">我的发货通知</span>
                    </div>
                    <div class="help">
						<a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/WDFHTZ.html');" class="linkstyle">帮助</a>
					</div>
                </div>
                <div class="margin8"></div>
                <div class="subpage_title">
                    <div class="title_index">
                        <img src="<%=path%>/images/common/dot03.gif" alt="" border="0" />&nbsp;我的发货通知</div>
                </div>
                <div class="margin20"></div>
                <div class="subpage_bidlist">
                    <div class="subpage_search" >
                    	<form name="form1" action="<%=path%>/other/qryOrderItemInfo2" method="post" >
	                        <table border="0" cellpadding="0" cellspacing="0" class="searchtable">
	                            <tr>
	                                <td valign="middle" class="w_1">订单号：</td>
	                                <td valign="middle" class="w_2">
	                                    <input id="qryOrderNo" name="qryOrderNo" type="text" value="" class="searchtext" />
	                                </td>
	                            	<td valign="middle" class="w_1">产品名称：</td>
	                                <td valign="middle" class="w_2">
	                                    <input id="qryProdName" name="qryProdName" type="text" value="" class="searchtext" />
	                                </td>
	                            </tr>
	                            <tr><td colspan="4">&nbsp;</td></tr>
	                            <tr>
	                                <td valign="middle" colspan="4" align="center">
	                                    <input type="submit" class="btnscs" value="查询" />&nbsp;&nbsp;
	                                </td>
	                            </tr>
	                        </table>
	                	</form>
                    </div>
                    <div class="margin20"></div>
                    <div>
                    	<form name="form2" method="post" >
	                        <table class="tableCss" cellpadding="0" cellspacing="0">
                            	<tr class="titleTr">
	                                <th width="40px">
	                                	<input type="checkbox" name="chkAll" id="chkAll" onclick="ChkAllClick('checkBox','chkAll')" />
	                                </th>
	                                <th width="200px">订单号</th>
	                                <th width="400px">产品</th>
	                                <th width="160px" class="th1">数量</th>
	                            </tr>
	                            <c:if test="${orderSubForms!=null}">
									<c:forEach items="${orderSubForms}" var="orderSubForm" varStatus="index">
										<c:if test="${orderSubForm.index%2==1}">
											<tr align="left" class="contTr-old"  >
										</c:if>
										<c:if test="${orderSubForm.index%2==0}">
											<tr align="left" class="contTr-even">
										</c:if>
											<td class="td1">
												<input type="hidden" name="orderNo" value="${orderSubForm.orderNo}"/>
												<input type="hidden" name="orderItemNo" value="${orderSubForm.orderItemNo}"/>
												<input type="hidden" name="pkOrg" value="${orderSubForm.pkOrg}" />
												<input type="hidden" name="pkOrder" value="${orderSubForm.pkOrder}" />
												<input type="hidden" name="pkItemOrder" value="${orderSubForm.pkItemOrder}" />
												<input type="hidden" name="pkArrPlan" value="${orderSubForm.pkArrPlan}" />
												<input type="hidden" name="pkWebArrPlan" value="${orderSubForm.pkWebArrPlan}" />
												<input type="hidden" name="pkProd" value="${orderSubForm.pkProd}" />
												<input type="hidden" name="mainUnitName" value="${orderSubForm.mainUnitName}" />
												<input type="hidden" name="pkMainUnit" value="${orderSubForm.pkMainUnit}" />
												<input type="hidden" name="pkAsisUnit" value="${orderSubForm.pkAsisUnit}" />
												<input type="hidden" name="asisUnitName" value="${orderSubForm.asisUnitName}" />
												<input type="hidden" name="orderMainNum" value="${orderSubForm.orderMainNum}" />
												<input type="hidden" name="orderAsisNum" value="${orderSubForm.orderAsisNum}" />
												<input type="hidden" name="pkReceiveCorp" value="${orderSubForm.pkReceiveCorp}" />
												<input type="hidden" name="receiveCorpName" value="${orderSubForm.receiveCorpName}" />
												<input type="hidden" name="pkReceiveAddr" value="${orderSubForm.pkReceiveAddr}" />
												<input type="hidden" name="receiveAdsName" value="${orderSubForm.receiveAdsName}" />
												<input type="hidden" name="pkSendAddr" value="${orderSubForm.pkSendAddr}" />
												<input type="hidden" name="sendAds" value="${orderSubForm.sendAds}" />
												<input type="hidden" name="pkTransfer" value="${orderSubForm.pkTransfer}" />
												<input type="hidden" name="transferName" value="${orderSubForm.transferName}" />
												<input type="hidden" name="hts" value="${orderSubForm.hts}" />
												<input type="hidden" name="bts" value="${orderSubForm.bts}" />
												<input type="hidden" name="bbts" value="${orderSubForm.bbts}" />
												<input type="hidden" name="pkArrStroorg" value="${orderSubForm.pkArrStroorg}" />
												<input type="hidden" name="ordernum" value="${orderSubForm.ordernum}" />
												<input type="hidden" name="sendNnum" value="${orderSubForm.sendNnum}" />
												<input type="hidden" name="changeRate" value="${orderSubForm.changeRate}" />
												<input type="hidden" name="pkOrg_v" value="${orderSubForm.pkOrg_v}" />
												<input type="hidden" name="pkProd_v" value="${orderSubForm.pkProd_v}" />
												<input type="hidden" name="pkArrStroorg_v" value="${orderSubForm.pkArrStroorg_v}" />
												<input type="hidden" name="qtUnitRate" value="${orderSubForm.qtUnitRate}" />
												<input type="hidden" name="prodCode" value="${orderSubForm.prodCode}" />
												<input type="hidden" name="pkQtUnit" value="${orderSubForm.pkQtUnit}" />
												<input type="hidden" id="pk_${orderSubForm.pkItemOrder}" name="selected" value="" />
												<input type="hidden" name="prodName" value="${orderSubForm.prodName}" /> <br/>
												<input type="hidden" name="model" value="${orderSubForm.model}" />
												<input type="hidden" name="type" value="${orderSubForm.type}" />
												<input type="hidden" name="desc" value="${orderSubForm.desc}" />
												<input type="hidden" name="measureName" value="${orderSubForm.measureName}" />
												<input type="hidden" name="leftNum" value="${orderSubForm.leftNum}"/>
												<input type="checkbox" id="${orderSubForm.pkItemOrder}" name="checkBox" />
											</td>
											<td class="td1">${orderSubForm.orderNo}</td>
											<td class="td1">
												<span class="prodName">${orderSubForm.prodName}</span><br/>
												<c:if test="${orderSubForm.model!=null && ''!=orderSubForm.model}">
													规格：${orderSubForm.model} <br/>
												</c:if>
												<c:if test="${orderSubForm.type!=null && ''!=orderSubForm.type}">
													型号：${orderSubForm.type}<br/>
												</c:if>
												<c:if test="${orderSubForm.desc!=null && ''!=orderSubForm.desc}">
													描述：${orderSubForm.desc}&nbsp;
												</c:if>
											</td>
											<td class="td1">
												${orderSubForm.leftNum}${orderSubForm.measureName}&nbsp;
											</td>
										</tr>
									</c:forEach>
								</c:if>
	                        </table>
	                        <br /> <br />
	                        <table  border="0" cellpadding="0" cellspacing="0" align="center">
	                        	 <tr>
	                                <td valign="middle" align="center">
	                                    <input type="button" class="btnscs" value="添加" onclick="addOrderArrPlan()"/>&nbsp;&nbsp;
	                                    <input type="reset" class="btnscs" value="返回" onclick="goback();"/>&nbsp;&nbsp;
	                                </td>
	                            </tr>
	                        </table>
	                	</form>
                    </div>
                    <div class="margin8"></div>
                    <div class="margin8">
                    	<table align="left">
							<tr class="title">
								<td>
									<div id="message" class="msgcolor">${system_err_msg}</div>
								</td>
							</tr>
						</table>
					</div> 
                </div>
            </div>
        <div class="margin20"></div>
</body>
</html>
